Rust: Address result duplication in rust/hard-coded-cryptographic-value - #22426
Open
geoffw0 wants to merge 3 commits into
Open
Rust: Address result duplication in rust/hard-coded-cryptographic-value#22426geoffw0 wants to merge 3 commits into
geoffw0 wants to merge 3 commits into
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Collapses constant match-arm sources into the enclosing match expression, preventing duplicate cryptographic-value alerts.
Changes:
- Treats qualifying match expressions as constant sources.
- Adds regression coverage and updates expected results.
- Documents the analysis improvement.
Show a summary per file
| File | Description |
|---|---|
HardcodedCryptographicValueExtensions.qll |
Adds match-expression source aggregation. |
test_cookie.rs |
Adds regression test coverage. |
HardcodedCryptographicValue.expected |
Updates generated expectations. |
2026-08-25-hardcoded-cryptographic-match-expressions.md |
Adds change note. |
Review details
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
- Files reviewed: 4/4 changed files
- Comments generated: 0
- Review effort level: Balanced
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Small fix for a result duplication issue in
rust/hard-coded-cryptographic-value. The issue is a match expression containing constants in each or many of the match arms, for example (from the test):It turns out this can cause quite severe multiplication of results in rare cases (e.g. imagine the above but with 100 cases, and flowing to 20 sinks). The solution is to make the match expression itself the source, as it's close enough to see what's going on with just one result.